#include<iostream>
#include<queue>
using namespace std;
class MyStack {
public:
    MyStack() 
    {

    }
    
    void push(int x) 
    {
        q.push_back(x);
    }
    
    int pop() 
    {
        int x=q.back();
        q.pop_back();
        return x;
    }
    
    int top() 
    {
        return q.back();
    }
    
    bool empty() 
    {
        return q.empty();
    }
    deque<int>::iterator begin()
    {
        return q.begin();
    }
    deque<int>::iterator end()
    {
        return q.end();
    }
private:
    deque<int> q;

};
void test()
{
    MyStack l;
    l.push(1);
    l.push(2);
    l.push(3);
    l.push(4);
    for(auto& e:l)
    {
        cout<<e<<"->";
    }
    cout<<endl;
}
int main()
{
    test();
    return 0;
}
